<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;}
    </style>
</head>
<body>
    <button>输入法</button>
    <div>
        <ul type="none">
            <li>手写</li>
            <li>拼音</li>
            <li>关闭</li>
        </ul>
    </div>
</body>
<script>
    var btn=document.querySelector("button")
    var div=document.querySelector("div")
    div.style.display="none"
    btn.onclick=function(){
        div.style.display=div.style.display=="block"?"none":"block"
    }
</script>
</html>